package com.brainshare.common.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * 提现卡状态枚举
 * @author wll
 */
public enum WithdrawalCardStatusEnum {
    //0：未提现 1：提现成功 2：提现失败 3：已失效
    NOT_GIVE(-1,"未发放"),
    NOT_WITHDRAWAL(0,"未提现"),
    WITHDRAWAL_SUCCESS(1,"提现成功"),
    WITHDRAWAL_FAIL(2,"提现失败"),
    EXPIRED(3,"已失效");

    private final Integer code;
    private final String info;

    WithdrawalCardStatusEnum(Integer code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public Integer getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }

    public static boolean checkWithdrawalCardStatusList(Integer withdrawalCardStatus)
    {
        List<Integer> withdrawalCardStatusList = getWithdrawalCardStatusList();
        return withdrawalCardStatusList.contains(withdrawalCardStatus);
    }

    public static List<Integer> getWithdrawalCardStatusList()
    {
        List<Integer> list=new ArrayList<>();
        list.add(WITHDRAWAL_SUCCESS.code);
        list.add(WITHDRAWAL_FAIL.code);
        list.add(EXPIRED.code);
        return list;
    }

}
